package Vue;




import java.awt.Component;
import java.awt.GridLayout;
import javax.swing.JComponent;
import javax.swing.JPanel;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Taupe
 */
public class Grille {
    
  
    public Case[][] grille;
    public int sizeX;
    public int sizeY;

    public Grille() {
        // Allocation mémoire de 10*10 pour la grille
        this.sizeX = 10;
        this.sizeY = 10;
        grille = new Case[10][10];
        // Pour chaque case, on alloue de la mémoire et on met l'indice à 0
        for(int i=0;i<10;i++)
        {
            for(int j=0;j<10;j++)
            {
                this.grille[i][j]= new Case(i,j); 
            }
            
        }
    }


    public Case getCaseGrille(int x,int y)
    {
        return this.grille[x][y];
    }
    
    public void setCaseGrille(Case c)
    {
        this.grille[c.getX()][c.getY()]=c;
    }
    
    public void test(Grille g)
    {
        Case c= new Case(5,5 ,2);
        g.setCaseGrille(c);
    }

}
